from assistoollib.DataSource.mysql import MySqlDataSource
from assistoollib.SyncTool.mailExchange import mailboxConfig

class appConfig:
    _instance = None

    client_factory = None  # 客户端工厂实例，用于创建Seatable客户端。
    event_trigger = None  # 事件触发器实例，用于管理和触发事件。

    def __new__(cls):
        if not cls._instance:
            cls._instance = super().__new__(cls)
            print("Database instance created")
        return cls._instance

    def __init__(self):
        self.mysql_config: MySqlDataSource = MySqlDataSource(
            ipAddress="app.shellingford.ip-ddns.com",
            port=5961,
            username="root",
            password="xj1983SH1216",
            database="assistool_db",
        )

        self.mailbox_config: mailboxConfig = mailboxConfig(
            imap_server = "imap.chinatelecom.cn",
            imap_port = 993,
            email_user = "xj31801318.sh@chinatelecom.cn",
            password = "7wU$gN6FH9ekeMMV",
            exchange_folder = "DataExchange",
        )


